from binance.BianAPI import *

def GetCoinNum(coinjson, ak, sk):
    bian = BitfinexClient(ak, sk)
    coins = bian.account_infos()
    myCoins = coins['balances']
    for i in myCoins:
        num = (float)(i['free'])
        num2 = (float)(i['locked'])
        if num > 0 or num2 > 0:
            if (i['asset'].lower() in coinjson.keys()):
                coinjson[i['asset'].lower()] = coinjson[i['asset'].lower()] + num + num2
            else:
                coinjson[i['asset'].lower()] = num + num2